package com.web.service;


import com.web.VO.MyPublishVO;
import com.web.VO.MyQuizVO;
import com.web.dao.AskQuestionsMapper;
import com.web.entity.ExpertsInfo;
import com.web.entity.MyExpertsList;
import com.web.entity.UserQuiz;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AskQuestionsService {
    @Resource
    private AskQuestionsMapper askQuestionsMapper;


    /**
     * 专家列表
     * @return
     */
    public List<ExpertsInfo> getExpertsList() {
        return askQuestionsMapper.getExpertsList();
    }

    /**
     * 用户提问
     * @param userQuiz
     */
    public void insertSelective(UserQuiz userQuiz) {
        askQuestionsMapper.insertSelective(userQuiz);
    }
    /**
    *查询提问
     */
    public UserQuiz findUserAskQuestions(Integer typeId) {
        return askQuestionsMapper.findUserAskQuestions(typeId);
    }

    /**
     * 修改收藏量
     * @param userQuiz
     */
    public void updateCollectionNum(UserQuiz userQuiz) {
        askQuestionsMapper.updateCollectionNum(userQuiz);
    }

    /**
     * 我发布的问答
     * @param userId
     * @return
     */
    public List<MyPublishVO> listMyPublishQuiz(String userId) {
        return askQuestionsMapper.listMyPublishQuiz(userId);
    }
}
